Path resolution for nested recursive modules
نویسندگان
چکیده
The ML module system facilitates the modular development of large programs, through decomposition, abstraction and reuse. To increase its flexibility, much work has been devoted to extending it with recursion, which is currently prohibited. The introduction of recursion certainly adds expressivity to the module system. However it also brings out non-trivial problems that a non-recursive module system does not have. In this paper, we address one of such problems, namely resolution of path references. Paths are how one refers to nested modules in ML. Without recursion, well-typedness guarantees termination of path resolution, in other words, we can statically determine the module that a path refers to. This does not always hold with recursive module extensions, since the module system then can encode a lambda-calculus with recursion, whose termination is undecidable regardless of welltypedness. We formalize this problem of path resolution by means of a rewrite system on paths and prove that the problem is undecidable even without higher-order functors, via an encoding of the Turing machine into a calculus with just recursive modules, first-order functors, and nesting. Motivated by this result, we introduce a further restriction on first-order functors, limiting polymorphism on functor parameters by requiring signatures for functor parameters to be non-recursive, and show that this restriction is decidable and admits terminating path resolution.
منابع مشابه
Analysis and implementation of hierarchical mutually recursive first class modules
This thesis presents a novel way to introduce mutually recursive first-class modules into a call-by-value programming language. In our approach, all modules are accessed through dot-notation without any additional syntax for mutually recursive modules. In contrast to other call-by-value languages, mutually recursive modules can be declared without the use of module composition or a self variabl...
متن کاملPath resolution for recursive modules
The ML module system enables flexible development of large software systems by its support of nested structures, functors and signatures. In spite of this flexibility, however, recursion between modules is prohibited, since dependencies between modules must accord with the order of definitions. As a result of this constraint, programmers may have to consolidate conceptually separate components ...
متن کاملPredicative Lexicographic Path Orders: Towards a Maximal Model for Primitive Recursive Functions
The predicative lexicographic path order (PLPO for short), a syntactic restriction of the lexicographic path order, is presented. As well as lexicographic path orders, several non-trivial primitive recursive equations, e.g., primitive recursion with parameter substitution, unnested multiple recursion, or simple nested recursion, can be oriented with PLPOs. It can be shown that PLPOs however onl...
متن کاملPredicative Lexicographic Path Orders - An Application of Term Rewriting to the Region of Primitive Recursive Functions
In this paper we present a novel termination order the predicative lexicographic path order (PLPO for short), a syntactic restriction of the lexicographic path order. As well as lexicographic path orders, several non-trivial primitive recursive equations, e.g., primitive recursion with parameter substitution, unnested multiple recursion, or simple nested recursion, can be oriented with PLPOs. I...
متن کاملRecursion for structured modules
This paper proposes an extension of the ML module system with recursion that keeps a flexible use of nested structures and functors. For the purpose of formal study, we design a calculus, called PathCal, which has a module system with nested structures and simple functors along with recursion. It is important for this calculus to guarantee resolvability of recursive references between modules. ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- Higher-Order and Symbolic Computation
دوره 24 شماره
صفحات -
تاریخ انتشار 2011